package net.flowas.jenkins.plugindownload;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

public class VersionsTransformer {

	public static void main(String[] args) throws IOException, URISyntaxException {
		URI groupIsdUri = Thread.currentThread().getContextClassLoader().getResource("antoGeneratedVersions.txt").toURI();
		List<String> lines = Files.readAllLines(Paths.get(groupIsdUri));
        for (String line : lines) {
			if(line.contains(":")) {
				String[] tokons = line.split(":");
				if(tokons.length>3) {
					//org.jenkins-ci.plugins:credentials:hpi:2.1.14:compile
					String artifactId = tokons[1].trim();
					String version = tokons[3];
					System.out.println(artifactId+":"+version);
				}
			}
		}
	}

}
